<template>
	<view class="content">
		<!-- @clickRight="onChooseBackImg" -->
		<!-- rightText="更换背景" -->
		<view class="nav_bar" :style="`background-color: rgba(255, 255, 255, ${trans});`">
			<uni-nav-bar :color="color" left-icon="left" title="" :border='false' :fixed="true"
				background-color="transparent" @clickLeft="back"></uni-nav-bar>
		</view>

		<!-- <view class="header flex_r_around">
			<view class="flex_c" @click="chooseAvatar">
				<image :src="info.avatar" mode="aspectFill"></image>
				<text>编辑头像</text>
			</view>
		</view> -->

		<view class="header">
			
			<swiper class="swiper-box" @change="change" :current="current">
				<swiper-item v-for="(item, index) in images_photos" :key="index">
					<image :src="item" mode="aspectFill"></image>
				</swiper-item>
			</swiper>
			
			<view class="swiper-dot flex_center">
				
				<view class="upload-images flex_r_around" @click="choosePhotos">
					<image :src="$util.prefix('public/upload-images.png')" mode="aspectFill"></image>
				</view>
				
				<view class="swiper-dot-flex-box">
					<scroll-view scroll-x="true">
						<view class="swiper-dot-list flex_center">
							<view class="item" v-for="(item,index) in images_photos" :key="index"
							:id="index == current ? 'select' : ''" @click="current = index">
								<image :src="item" mode="aspectFill"></image>
								
								<view class="swiper-dot-icon" @click.stop="onDetele(index)">
									<u-icon name="close-circle-fill" size="32rpx" color="#FD2A53"></u-icon>
								</view>
							</view>
						</view>
					</scroll-view>
				</view>
			</view>
			
		</view>

		<view class="write_content">
			<!-- <view class="photos">
				<view class="photos_title flex_r_between">
					<view class="left flex_center">
						<view>入驻门店图片</view>
						<text>(门头照、环境照)</text>
					</view>
					<view class="right">{{getPhotosNum()}}/{{images_photos.length}}</view>
				</view>

				<scroll-view scroll-x="true">
					<view class="images flex_center">
						<view class="image_box" v-for="(item,index) in images_photos" :key="index">
							<view class="no_image flex_r_around" v-if="!item" @click="choosePhotos(index)">
								<u-icon name="plus" :size="24" color="#666"></u-icon>
							</view>
							<view class="have_image" v-else>
								<image :src="item" mode="aspectFill" @click="choosePhotos(index)"></image>
								<view class="icon" @click.stop="onDetele(index)">
									<u-icon name="close-circle-fill" :size="24" color="#FD2A53"></u-icon>
								</view>
							</view>
						</view>
					</view>
				</scroll-view>
			</view> -->

			<view class="title">基本信息</view>

			<view class="input_box flex_r_between" @click="chooseAvatar">
				<text class="label">头像</text>
				<view class="avatar flex_center">
					<image :src="info.avatar" mode="aspectFill" class="avatar_image"></image>
					<image :src="$util.prefix('public/arrow-right-fill.png')" class="icon_image"></image>
				</view>
			</view>

			<view class="input_box flex_center">
				<text class="label">商家名称</text>
				<input :disabled="status == 1" type="text" v-model="info.nickname" placeholder="请输入"
					placeholder-class="input-placeholder" />
			</view>

			<view class="input_box flex_center">
				<text class="label">联系方式</text>
				<input :disabled="status == 1" type="number" maxlength="11" v-model="info.store_mobile"
					placeholder="请输入" placeholder-class="input-placeholder" />
			</view>

			<view class="sign">
				<view class="text_write">
					<textarea v-model="info.signature" placeholder="店铺介绍" placeholder-class="input-placeholder"
						:disabled="status == 1"></textarea>
				</view>
				<!-- <view class="how" v-if="signCase.length != 0">
					<view class="top flex_r_between">
						<text class="top_text">怎么样介绍自己好呢？</text>
						<view class="icon_button flex_center" @click="refreshSign">
							<image src="/static/auth/my_refresh_icon.png" mode="aspectFill"></image>
							<text>签名范例</text>
						</view>
					</view>
					<view class="bottom" @click="onSign">
						{{signCase[signIndex].message}}
					</view>
				</view> -->
			</view>

			<view class="choose_box flex_r_between" @click="chooseAddress">
				<text class="label">位置</text>
				<view class="view flex_center">
					<text class="text hidden">{{info.address}}</text>
					<u-icon name="arrow-right" color="#131313" :size="16"></u-icon>
				</view>
			</view>

			<!-- <view class="choose_box flex_r_between">
				<text class="label">经营年限</text>
				<picker @change="onServiceYearChange" :range="service_year_columns">
					<view class="view flex_center">
						<text class="text">{{
							info.service_year ? info.service_year + '年' : ''
						}}</text>
						<u-icon name="arrow-right" color="#131313" :size="16"></u-icon>
					</view>
				</picker>
			</view> -->

			<view class="title">行业</view>

			<view class="category flex_r_between">
				<view class="category_list" @click="show = true">
					<view class="flex_r_between">
						<text class="hidden"
							:style="`color: ${category_pname ? '#333' : '#999999'}`">{{category_pname ? category_pname : '如:本地生活'}}</text>
						<u-icon name="arrow-right" color="#131313" :size="16"></u-icon>
					</view>
				</view>
				<view class="category_list" @click="show = true">
					<view class="flex_r_between">
						<text class="hidden"
							:style="`color: ${category_name ? '#333' : '#999999'}`">{{category_name ? category_name : '如:本地生活'}}</text>
						<u-icon name="arrow-right" color="#131313" :size="16"></u-icon>
					</view>
				</view>
			</view>

			<view class="store-type">
				 <!-- @click="show_auth_type = true" -->
				<view class="choose_box flex_r_between">
					<text class="label">店铺类型</text>
					<view class="view flex_center">
						<text class="text hidden"></text>
						<u-icon name="arrow-right" color="#131313" :size="16"></u-icon>
					</view>
				</view>

				<view class="choose-tags flex_r_between">
					<view class="item flex_r_around" @click="info.store_type = 1">
						<view class="flex_center">
							<text>上门服务</text>
							<view class="icon" v-if="info.store_type == 1">
								<u-icon name="checkbox-mark" color="#FD2A53" size="32rpx"></u-icon>
							</view>
							<view class="icon" v-else>
								<u-icon name="checkbox-mark" color="transparent" size="32rpx"></u-icon>
							</view>
						</view>
					</view>

					<view class="item flex_r_around" @click="info.store_type = 2">
						<view class="flex_center">
							<text>到店使用</text>
							<view class="icon" v-if="info.store_type == 2">
								<u-icon name="checkbox-mark" color="#FD2A53" size="32rpx"></u-icon>
							</view>
							<view class="icon" v-else>
								<u-icon name="checkbox-mark" color="transparent" size="32rpx"></u-icon>
							</view>
						</view>
					</view>

					<view class="item flex_r_around" @click="info.store_type = 3">
						<view class="flex_center">
							<text>网购邮寄</text>
							<view class="icon" v-if="info.store_type == 3">
								<u-icon name="checkbox-mark" color="#FD2A53" size="32rpx"></u-icon>
							</view>
							<view class="icon" v-else>
								<u-icon name="checkbox-mark" color="transparent" size="32rpx"></u-icon>
							</view>
						</view>
					</view>


				</view>

				<view class="have-people flex_r_between" v-if="info.store_type == 1">
					<view class="left">
						商品是否有服务人员
					</view>
					<view class="right flex_center">
						<view class="item flex_center" @click="info.open_staff = 2">
							<u-icon name="checkmark-circle-fill" :color="info.open_staff == 2 ? '#FD2A53' : '#CCCCCC'"
								size="32rpx"></u-icon>
							<text>是</text>
						</view>

						<view class="item flex_center" @click="info.open_staff = 1">
							<u-icon name="checkmark-circle-fill" :color="info.open_staff ==1 ? '#FD2A53' : '#CCCCCC'"
								size="32rpx"></u-icon>
							<text>否</text>
						</view>
					</view>
				</view>

			</view>

			<!-- 标签 -->
			<view class="tags flex_center">


				<!-- <view class="tags_input flex_center">
					<view class="placeholder">{{ info.tags.length > 0 ? '继续添加' : '请输入' }}</view>
				</view> -->

				<view class="tags-label">店铺标签</view>

				<view class="tags-content">
					<scroll-view scroll-x="true">
						<view class="tags_list flex_center">
							<view class="tags_item flex_r_around" v-for="(item,index) in tags" :key="index">
								<text>{{ item }}</text>
								<view class="tags_list_icon" @click="tags.splice(index , 1)">
									<u-icon name="close-circle-fill" color="#FD2A53" size="32rpx"></u-icon>
								</view>
							</view>
						</view>
					</scroll-view>
				</view>

				<view class="tags-btn flex_r_around" @click="show_tags = true">
					<text>添加</text>
				</view>

			</view>

			<!-- <view class="title">商家认证</view>

			<view class="input_box flex_center">
				<text class="label">法人姓名</text>
				<input :disabled='status != 0 && status != 3' type="text" v-model="info.legal_person" placeholder="请输入"
					placeholder-class="input-placeholder" />
			</view>

			<view class="input_box flex_center" style="margin-top: 20rpx;">
				<text class="label">法人身份证号</text>
				<input :disabled='status != 0 && status != 3' type="text" v-model="info.id_card_num" placeholder="请输入"
					placeholder-class="input-placeholder" />
			</view>

			<view class="business_license_img">
				<image :src="info.business_license_img" mode="aspectFill" @click="onChooseBusiness"></image>
			</view>

			<view class="input_box flex_center" style="margin-top: 20rpx;" v-if="info.business_license_num">
				<text class="label">营业执照号码</text>
				<input :disabled='status != 0 && status != 3' type="text" v-model="info.business_license_num"
					placeholder="请输入" placeholder-class="input-placeholder" />
			</view>

			<view class="input_box flex_center" style="margin-top: 20rpx;" v-if="info.business_license_num">
				<text class="label">经营范围</text>
				<input :disabled='status != 0 && status != 3' type="text" v-model="info.business_scope"
					placeholder="请输入" placeholder-class="input-placeholder" />
			</view>

			<view class="input_box flex_center" style="margin-top: 20rpx;" v-if="info.business_license_num">
				<text class="label">注册时间</text>
				<input :disabled='status != 0 && status != 3' type="text" v-model="info.registre_time" placeholder="请输入"
					placeholder-class="input-placeholder" />
			</view>
			<view class="input_box flex_center" style="margin-top: 20rpx;" v-if="info.business_license_num">
				<text class="label">公司名称</text>
				<input :disabled='status != 0 && status != 3' type="text" v-model="info.company_name" placeholder="请输入"
					placeholder-class="input-placeholder" />
			</view> -->

			<!-- <view class="auth_text" @click="$util.toUrl('/pages/auth/authcenter?from_web=1')"
				v-if="company_status != 2">
				请先完 "个人认证" 和 "企业认证"
			</view> -->

			<view class="submit_btn" @click="onSubmit" v-if="status == 0">提交</view>
			<view class="submit_btn" v-if="status == 1">审核中</view>
			<view class="submit_btn" @click="onSubmit" v-if="status == 2">保存</view>
			<view class="submit_btn" @click="onSubmit" v-if="status == 3">
				审核未通过
			</view>

			<view class="return_text" v-if="status == 3">拒绝原因:（{{remark}}）</view>

			<u-picker keyName="name" :show="show" ref="uPicker" :columns="columns" @cancel="show = false"
				@change="onColumnsChange" @confirm="onColumnsComfirm"></u-picker>

		</view>

		<w-compress ref='wCompress' />

		<u-popup :show="show_auth" mode="center" bgColor="transparent">
			<view class="modal flex_c">
				<!-- <view class="icon flex_center">
					<u-icon name="close-circle" color="#CCCCCC" size="48rpx" @click="show = false"></u-icon>
				</view> -->
				<view class="title">提示</view>
				<view class="text">请先完成企业认证后申请开通店铺</view>
				<view class="modal_btn flex_r_around">
					<view class="item submit flex_r_around" @click="$util.toUrl('/pages/auth/authcenter')">
						<text>确定</text>
					</view>
				</view>
			</view>
		</u-popup>

		<u-popup :show="show_tags" @close="show_tags = false" mode="center" round="40rpx">
			<view class="modal_tags">
				<view class="modal_title flex_r_between">
					<text>标签</text>
					<u-icon name="close-circle" color="#CCCCCC" size="48rpx" @click="show_tags = false"></u-icon>
				</view>

				<view class="modal_textarea">
					<textarea placeholder="请输入" placeholder-class="input-placeholder" v-model="tags_input"
						maxlength="6"></textarea>
				</view>

				<view class="modal_btn flex_r_around" @click="onEenterTag">
					<text>确定</text>
				</view>

			</view>
		</u-popup>

		<u-action-sheet :actions="auth_type_list" title="" :show="show_auth_type" @close="show_auth_type = false"
			@select="onShowAuthType" cancelText="取消">
		</u-action-sheet>


	</view>
</template>

<script>
	import WCompress from '@/components/w-compress/w-compress.vue';
	export default {
		components: {
			WCompress
		},
		data() {
			return {
				info: {
					// 店铺背景
					background_image: '',
					// 店铺名
					nickname: '',
					// 店铺logo
					avatar: 'https://qiniu-cdn.maeiyun.com//h5static/logo.png',
					// 联系方式
					store_mobile: '',
					// 签名
					signature: '',
					images: '',
					// 经营年限
					service_year: '',
					// 法人姓名
					legal_person: '',
					// 法人身份证
					id_card_num: '',
					// 商家类别
					category_ids: '0',
					// 营业执照
					business_license_img: 'https://qiniu-cdn.maeiyun.com//h5static/auth/business_license_img.png',
					// 营业执照号码
					business_license_num: '',
					// 经营范围
					business_scope: '',
					// 注册时间
					registre_time: '',
					// 公司名称
					company_name: '',

					// 省市区 地址
					province: '',
					city: '',
					area: '',
					address: '',
					lat: '',
					lng: '',

					// 个人 or 企业
					type: 1,

					circle_id: 0,

					tags: '',

					// 店铺类型:1=上门服务,2=到店使用,3=网购邮寄
					store_type: 1,
					// 是否开通选择员工:1=不打开,2=开通
					open_staff: 1,
				},

				images_photos: [],

				signCase: [],
				signIndex: 0,

				// 经营年份
				service_year_columns: ['1', '2', '3', '4', '5'],

				// 审核状态
				status: 0,

				show: false,
				loading: false,

				// 商家分类
				category_pname: '',
				category_name: '',
				columns: [
					[],
					[]
				],
				// 分类储存区
				storeType: [],

				// 审核备注
				remark: '',

				trans: 0,
				color: '#FFF',

				company_status: 0,

				show_auth: false,

				tags_input: '',
				tags: [],
				show_tags: false,

				show_auth_type: false,

				auth_type_list: [{
						name: '个人创建',
						type: 1,
					},
					{
						name: '企业创建',
						type: 2,
					},
				],

				from_web: 0,
				
				current: 0,
			}
		},
		methods: {
			change(e) {
				this.current = e.detail.current;
			},
			
			getPhotosNum() {
				var num = 0;
				this.images_photos.forEach((element) => {
					if (element) {
						num++
					}
				});
				return num;
			},

			// 店铺背景图
			onChooseBackImg() {
				if (this.status == 1) {
					return;
				}
				this.$native.authorize('photos');
				uni.chooseImage({
					count: 1,
					sizeType: 'compressed',
					success: (file) => {
						this.$refs.wCompress.start(file.tempFilePaths[0], {
							pixels: 2000000, // 最大分辨率，默认二百万
							quality: 0.6, // 压缩质量，默认0.8
							type: 'png', // 图片类型，默认jpg
							// base64: false, // 是否返回base64，默认false，非H5有效
						}).then(url => {
							this.$upload(url, {
								type: 'picture'
							}).then(res => {
								if (res.status == 2 || res.status == 1) {
									this.info.background_image = res.result.url
								} else {
									this.$util.msg(res.msg)
								}
							})
						})

					},
					fail(err) {
						this.$util.msg(err)
					}
				})
			},

			// 店铺头像
			chooseAvatar() {
				if (this.status == 1) {
					return;
				}
				this.$native.authorize('photos');
				uni.chooseImage({
					count: 1,
					sizeType: 'compressed',
					crop: {
						width: 500,
						height: 500
					},
					success: (file) => {
						uni.navigateTo({
							url: `/pages/index/cropper?src=${file.tempFilePaths[0]}`,
							events: {
								getImage: (data) => {
									// console.log(data,'参数')
									this.info.avatar = data.src
								}
							}
						});
						// this.$refs.wCompress.start(file.tempFilePaths[0], {
						// 	pixels: 2000000, // 最大分辨率，默认二百万
						// 	quality: 0.6, // 压缩质量，默认0.8
						// 	type: 'png', // 图片类型，默认jpg
						// 	// base64: false, // 是否返回base64，默认false，非H5有效
						// }).then(url => {
						// 	this.$upload(url, {
						// 		type: 'picture'
						// 	}).then(res => {
						// 		if (res.status == 2 || res.status == 1) {
						// 			this.info.avatar = res.result.url
						// 		} else {
						// 			this.$util.msg(res.msg)
						// 		}
						// 	})
						// });
					},
					fail(err) {
						this.$util.msg(err)
					}
				})
			},

			choosePhotos() {
				if (this.status == 1) {
					return;
				}
				if(this.images_photos.length >= 9){
					return this.$util.msg('最多添加九张');
				}
				this.$native.authorize('photos');
				uni.chooseImage({
					count: 1,
					sizeType: 'compressed',
					crop: {
						width: 500,
						height: 500
					},
					success: (file) => {
						this.$refs.wCompress.start(file.tempFilePaths[0], {
							pixels: 2000000, // 最大分辨率，默认二百万
							quality: 0.6, // 压缩质量，默认0.8
							type: 'png', // 图片类型，默认jpg
							// base64: false, // 是否返回base64，默认false，非H5有效
						}).then(url => {
							this.$upload(url, {
								type: 'picture'
							}).then(res => {
								if (res.status == 2 || res.status == 1) {
									this.images_photos.push(res.result.url)
								} else {
									this.$util.msg(`${res.msg}`);
								}
							});
						});
					},
					fail(err) {
						this.$util.msg(err)
					}
				})
			},

			// 上传营业执照
			onChooseBusiness() {
				if (this.status != 0 && this.status != 3) {
					return;
				}
				this.$native.authorize('photos');
				uni.chooseImage({
					count: 1,
					sizeType: 'compressed',
					crop: {
						width: 500,
						height: 500
					},
					success: (file) => {
						this.$refs.wCompress.start(file.tempFilePaths[0], {
							pixels: 2000000, // 最大分辨率，默认二百万
							quality: 0.6, // 压缩质量，默认0.8
							type: 'png', // 图片类型，默认jpg
							// base64: false, // 是否返回base64，默认false，非H5有效
						}).then(url => {
							this.$uploadOCR(url, {
								type: 'picture',
								ocr_type: 2
							}).then(res => {
								if (res.data.status == 1) {
									this.info.business_license_img = res.data.url
									// // 营业执照号码
									this.info.business_license_num = res.data.data.creditCode;
									// // 经营范围
									this.info.business_scope = res.data.data.businessScope;
									// // 注册时间
									this.info.registre_time = res.data.data.RegistrationDate;
									// 法人
									this.info.legal_person = res.data.data.legalPerson;
									// 公司名称
									this.info.company_name = res.data.data.companyName;

								} else {
									this.$util.msg(res.msg)
								}
							})
						});

					},
					fail(err) {
						this.$util.msg(err)
					}
				})
			},

			getSignCase() {
				this.$get('/index/getSignCase', {
					type: 2,
				}).then(res => {
					res.data.forEach(element => {
						this.signCase.push(element);
					})
				})
			},

			refreshSign() {
				this.signIndex++;
				if (this.signIndex >= this.signCase.length) {
					this.signIndex = 0;
				}
			},

			// 使用快捷签名
			onSign() {
				if (this.status == 1) {
					return
				}
				this.info.signature = this.signCase[this.signIndex].message
			},

			// 选择商家位置
			chooseAddress() {
				if (this.status == 1 || this.status == 2) {
					return this.$util.msg('当前无法修改位置');;
				}
				// this.$native.authorize('location');
				uni.showLoading({
					mask: true
				});
				uni.chooseLocation({
					// latitude: res.latitude,
					// longitude: res.longitude,
					success: (loca) => {
						uni.hideLoading();
						this.info.address = loca.name;
						this.info.lat = loca.latitude;
						this.info.lng = loca.longitude;
						this.$get('index/getAddressByLocation', {
							location: `${loca.latitude},${loca.longitude}`
						}).then(res => {
							console.log(res);
							if (res.data.status == 0) {
								var result = res.data.result;
								this.info.province = result.ad_info.province;
								this.info.city = result.ad_info.city;
								this.info.area = result.ad_info.district;
							} else {
								this.$util.msg('地址解析失败')
							}
						})
					},

					fail(err) {
						uni.hideLoading();
						console.log(err);
					}


				})

			},

			// 选择经营年限
			onServiceYearChange(e) {
				if (this.status != 0 && this.status != 3) {
					return this.$util.msg('当前无法修改经营年限');
				}
				this.info.service_year = this.service_year_columns[e.detail.value]
			},

			// 获取商家认证信息
			getStoreAuthInfo() {
				this.$post('/store/getStoreAuthInfo', {}, false).then(res => {
					if (res.data.status) {
						this.status = res.data.status || 0;
						this.info.avatar = res.data.avatar;
						this.info.images = res.data.images;
						this.info.background_image = res.data.background_image;
						this.info.address = res.data.address;
						this.info.area = res.data.area;
						this.info.business_license_img = res.data.business_license_img;
						this.info.business_license_num = res.data.business_license_num;
						this.info.business_scope = res.data.business_scope;
						this.remark = res.data.check_content;
						this.info.city = res.data.city;
						this.info.id_card_num = res.data.id_card_num;
						this.info.lat = res.data.lat;
						this.info.lng = res.data.lng;
						this.info.legal_person = res.data.legal_person;
						this.info.name = res.data.name;
						this.info.province = res.data.province;
						this.info.registre_time = res.data.registre_time;
						this.info.service_year = res.data.service_year;
						this.info.signature = res.data.signature;
						this.info.nickname = res.data.store_name;
						this.info.store_mobile = res.data.store_mobile;
						this.info.type = res.data.type;
						this.info.store_type = res.data.store_type;
						this.info.open_staff = res.data.open_staff;
						
						if(res.data.tags){
							this.tags = res.data.tags.split(',');
						}else {
							this.tags = [];
						}
						
						this.images_photos = [];
						for (var i = 0; i < res.data.images.length; i++) {
							this.images_photos.push(res.data.images[i].url)
							// console.log(this.images_photos);
						};

						// 2024.11.10 删除 category_ids 含 0 的数据 ， 保证 category_ids 只保留一项 (后台操作)
						if (res.data.category_ids.length > 0) {
							this.info.category_ids =
								`${res.data.category_ids[0].category_id}`;
							this.storeType.forEach((element) => {
								if (element.id == res.data.category_ids[0].category_pid) {
									this.category_pname = element.name;
									element.child.forEach(e => {
										if (e.id == res.data.category_ids[0].category_id) {
											this.category_name = e.name
										}
									})
								}
							});
						}
					}

				})
			},

			// 获取商家分类
			getStoreType() {
				this.$get('/category/getStoreType').then(res => {
					// console.log(res);
					this.storeType = res.data;
					res.data.forEach((element) => {
						this.columns[0].push({
							"name": element.name,
							"pid": element.pid,
							"id": element.id,
						});
					})
					this.columns[1] = res.data[0].child;
					this.getStoreAuthInfo();
				})
			},

			onColumnsChange(e) {
				if (e.columnIndex == 0) {
					var picker = this.$refs.uPicker;
					picker.setColumnValues(1, this.storeType[e.index].child)
				}
			},

			onColumnsComfirm(e) {
				if (this.status != 0 && this.status != 3) {
					this.show = false;
					return this.$util.msg('当前无法修改商家类别');
				}
				this.category_pname = e.value[0].name;
				this.category_name = e.value[1].name;
				this.info.category_ids = `${e.value[1].id}`;
				this.show = false;
			},

			onSubmit() {

				var arr = [];
				this.images_photos.forEach((element) => {
					if (element) {
						arr.push(element);
					}
				});

				if (this.info.category_ids == '0') {
					return this.$util.msg('请选择类别');
				}

				if (!this.info.province || !this.info.city || !this.info.area) {
					return this.$util.msg('请选择地址');
				}

				this.info.images = arr.join(',');
				if (!this.tags.length) {
					return this.$util.msg('清添加标签')
				}
				
				var tags = this.tags;
				this.info.tags = tags.join(',');

				uni.showLoading();
				this.$post('/store/setStoreAuthInfo', this.info, true, () => {
					uni.hideLoading();
				}).then((res) => {
					uni.hideLoading();
					this.$util.msg(res.msg);
					this.getStoreAuthInfo();
				})
			},

			onDetele(index) {
				if (this.status == 1) {
					return this.$util.msg('审核中 请耐心等待');
				}
				this.images_photos.splice(index,1)
			},

			getCompanyAuth() {
				this.$post('/circle.circle/getCompanyAuth').then(res => {
					this.company_status = res.data.company_status;
					if (this.company_status != 2) {
						this.show_auth = true;
					}
				});
			},

			onEenterTag(e) {
				if (!this.tags_input) {
					return this.$util.msg('请填写标签')
				}
				if (this.tags.length < 10) {
					this.tags.push(this.tags_input);
				}
				this.tags_input = '';
				this.show_tags = false;
			},

			onShowAuthType(e) {
				this.info.type = e.type;
			},

			back() {
				if (this.from_web == 1) {
					this.$util.back();
				} else {
					this.$native.backAction();
				}
			},

		},

		onLoad(option) {
			if (option.token) {
				uni.setStorageSync('token', option.token);
				uni.setStorageSync('cid', option.cid);
				uni.setStorageSync('terminal', option.terminal);
			}
			if (option.type) {
				this.info.type = option.type;
			}
			this.info.circle_id = option.circle_id || 0;
			this.from_web = option.from_web || 0;

			this.getSignCase();
			this.getStoreType();
			// this.getCompanyAuth();
		},

		onPageScroll: function(e) { //nvue暂不支持滚动监听，可用bindingx代替
			if (e.scrollTop <= 200) {
				this.trans = e.scrollTop / 200;
				if (e.scrollTop <= 100) {
					this.color = '#FFF';
				} else {
					this.color = '#999';
				}
			} else {
				this.trans = 1;
				this.color = '#333';
			}
		},
	}
</script>

<style lang="less" scoped>
	.header {
		height: calc(340rpx + var(--paging-head-top));
		overflow: hidden;
		position: relative;
		
		.swiper-box {
			width: 100vw;
			height: calc(340rpx + var(--paging-head-top));
		
			swiper-item {
				width: 100vw;
				height: calc(340rpx + var(--paging-head-top));
		
				image {
					width: 100vw;
					height: calc(340rpx + var(--paging-head-top));
				}
			}
		}
	
		.swiper-dot {
			position: absolute;
			left: 32rpx;
			bottom: 32rpx;
			width: calc(100vw - 64rpx);
			align-items: flex-end;

			scroll-view {
				height: 140rpx;
			}
			
			.swiper-dot-flex-box {
				overflow: hidden;
				height: 140rpx;
				flex: 1;
			}
			
			#select {
				image {
					border: 4rpx solid #FD2A53;
				}
			}
			
			.swiper-dot-list {
				height: 140rpx;
				align-items: flex-end;
			}
			
			.item {
				margin-right: 16rpx;
				position: relative;
				
				.swiper-dot-icon {
					position: absolute;
					right: -16rpx;
					top: -16rpx;
				}
				
				image {
					width: 106rpx;
					height: 106rpx;
					border: 4rpx solid transparent;
					border-radius: 16rpx;
				}
			}
		
			.upload-images {
				width: 114rpx;
				height: 140rpx;
				flex-shrink: 0;
				margin-right: 16rpx;
				padding-top: 4rpx;
				
				image {
					width: 114rpx;
					height: 114rpx;
				}
			}
		
		}
	
	}

	.write_content {
		padding: 10rpx 32rpx 38rpx;
		margin-top: 0;
		background: #FFFFFF;

		.photos {
			.photos_title {
				.left {
					view {
						font-weight: 500;
						font-size: 32rpx;
						color: #131313;
						margin-right: 16rpx;
					}

					text {
						font-size: 28rpx;
						color: #999999;
					}
				}

				.right {
					font-size: 28rpx;
					color: #999999;
				}
			}

			.images {
				margin-top: 32rpx;

				.image_box {
					margin-right: 16rpx;

					.no_image {
						width: 248rpx;
						height: 308rpx;
						background: #F8F8F8;
						border-radius: 16rpx;
					}

					.have_image {
						width: 248rpx;
						height: 308rpx;
						border-radius: 16rpx;
						overflow: hidden;
						position: relative;

						image {
							width: 248rpx;
							height: 308rpx;
						}

						.icon {
							position: absolute;
							right: 12rpx;
							top: 12rpx;
						}

					}
				}
			}

		}

		.title {
			margin-top: 32rpx;
			margin-bottom: 32rpx;
			font-weight: 500;
			font-size: 32rpx;
			color: #131313;
		}

		.input_box {
			height: 100rpx;
			background: #F8F8F8;
			border-radius: 16rpx;
			padding: 0 32rpx;
			margin-bottom: 22rpx;

			.label {
				font-size: 32rpx;
				color: #131313;
			}

			input {
				flex: 1;
				text-align: right;
				font-size: 28rpx;
				color: #131313;
			}

			.avatar {
				.avatar_image {
					width: 72rpx;
					height: 72rpx;
					border-radius: 36rpx;
				}

				.icon_image {
					width: 22rpx;
					height: 22rpx;
					margin-left: 8rpx;
				}
			}
		}

		.sign {
			background: #F8F8F8;
			border-radius: 16rpx;
			margin-top: 20rpx;
			padding: 28rpx;

			.text_write {
				height: 208rpx;
				background: #F8F8F8;
				overflow: hidden;

				textarea {
					font-size: 28rpx;
					color: #131313;
					line-height: 44rpx;
				}
			}

			.how {
				padding: 0 32rpx;

				.top {
					.top_text {
						font-size: 28rpx;
						color: #131313;
					}

					.icon_button {
						width: 184rpx;
						height: 56rpx;
						background: #EEEEEE;
						border-radius: 28rpx;

						image {
							width: 24rpx;
							height: 24rpx;
							margin: 0 6rpx 0 18rpx;
						}

						text {
							font-weight: 500;
							font-size: 28rpx;
							color: #131313;
						}
					}
				}

				.bottom {
					font-size: 28rpx;
					color: #131313;
					margin-top: 32rpx;
				}
			}
		}

		.choose_box {
			height: 100rpx;
			background: #F8F8F8;
			border-radius: 16rpx;
			padding: 0 32rpx;
			margin-top: 20rpx;

			.label {
				font-size: 32rpx;
				color: #131313;
			}

			.view {
				flex: 1;

				.text {
					flex: 1;
					font-size: 28rpx;
					color: #131313;
					text-align: right;
				}
			}
		}

		.category {
			.category_list {
				padding: 0 32rpx;
				width: 328rpx;
				height: 100rpx;
				background: #F8F8F8;
				border-radius: 16rpx;

				view {
					height: 100rpx;

					text {
						font-size: 32rpx;
						color: #999999;
					}
				}
			}
		}

		.business_license_img {
			height: 344rpx;
			width: 686rpx;
			margin: 32rpx 0;

			image {
				width: 686rpx;
				height: 344rpx;
			}
		}

		.submit_btn {
			height: 96rpx;
			background: #FD2A53;
			border-radius: 48rpx;
			font-weight: 500;
			font-size: 28rpx;
			color: #FFFFFF;
			line-height: 96rpx;
			text-align: center;
			margin: 32rpx 0 20rpx;
		}

		.return_text {
			font-size: 24rpx;
			color: #131313;
		}

	}

	.modal {
		width: 616rpx;
		background: #FFFFFF;
		border-radius: 40rpx;
		padding: 80rpx 68rpx 48rpx;

		.title {
			font-weight: 500;
			font-size: 36rpx;
			color: #FD2A53;
			line-height: 50rpx;
			margin: 16rpx 0 8rpx;
		}

		.text {
			font-size: 28rpx;
			color: #666666;
			line-height: 40rpx;
			text-align: center;
		}

		.modal_btn {
			margin-top: 42rpx;

			.item {
				height: 88rpx;
				border-radius: 44rpx;
				width: 320rpx;

				text {
					font-size: 28rpx;
				}
			}

			.submit {
				background: #FD2A53;

				text {
					color: #FFF;
				}
			}
		}

		.icon {
			width: 100%;
			flex-direction: row-reverse;
		}
	}

	.auth_text {
		padding: 20rpx 0;
		font-size: 28rpx;
		color: #FD2A53;
		line-height: 40rpx;
	}

	.modal_tags {
		width: 616rpx;
		background: #FFFFFF;
		border-radius: 40rpx;
		padding: 34rpx 16rpx 38rpx 32rpx;

		.modal_title {
			text {
				font-weight: 500;
				font-size: 36rpx;
				color: #131313;
				line-height: 50rpx;
			}
		}

		.modal_textarea {
			width: 552rpx;
			height: 208rpx;
			background: #F7F7F7;
			border-radius: 16rpx;
			padding: 24rpx;
			margin: 32rpx 0;
			overflow: hidden;

			textarea {
				font-size: 28rpx;
				color: #333;
				line-height: 36rpx;
			}
		}

		.modal_btn {
			width: 320rpx;
			height: 88rpx;
			background: #FD2A53;
			border-radius: 44rpx;
			margin: 0 auto;

			text {
				font-size: 28rpx;
				color: #FFFFFF;
			}
		}

	}

	.tags {
		height: 100rpx;
		background: #F7F7F7;
		border-radius: 16rpx;
		margin-top: 20rpx;
		padding: 0 32rpx;

		.tags_list {
			padding: 0 12rpx;

			.tags_item {
				flex-shrink: 0;
				height: 48rpx;
				background: #E5E5E5;
				border-radius: 8rpx;
				padding: 0 36rpx;
				margin: 8rpx 20rpx 8rpx 0;
				position: relative;

				text {
					font-weight: 500;
					font-size: 28rpx;
					color: #131313;
					line-height: 56rpx;
				}

				.tags_list_icon {
					position: absolute;
					right: -12rpx;
					top: -12rpx;
				}

			}
		}

		.tags-label {
			font-size: 32rpx;
			color: #131313;
			line-height: 44rpx;
			flex-shrink: 0;
		}

		.tags-content {
			flex: 1;
			overflow: hidden;

			scroll-view {
				width: 100%;
			}
		}

		.tags-btn {
			width: 112rpx;
			height: 48rpx;
			background: #FFFFFF;
			border-radius: 24rpx;
			border: 2rpx solid #FD2A53;
			flex-shrink: 0;

			text {
				font-size: 28rpx;
				color: #FD2A53;
				line-height: 40rpx;
			}
		}

	}

	.store-type {
		background: #F8F8F8;
		border-radius: 16rpx;
		padding-bottom: 24rpx;

		.choose-tags {
			padding: 0 24rpx;

			.item {
				width: 200rpx;
				height: 72rpx;
				background: #EFEFEF;
				border-radius: 16rpx;

				text {
					font-size: 28rpx;
					color: #131313;
					line-height: 40rpx;
					margin-right: 12rpx;
				}
			}
		}

		.have-people {
			margin: 16rpx 24rpx 0;
			height: 96rpx;
			background: #EFEFEF;
			border-radius: 16rpx;
			padding: 0 24rpx;

			.left {
				font-size: 28rpx;
				color: #131313;
				line-height: 40rpx;
			}

			.right {
				.item {
					margin-left: 64rpx;

					text {
						margin-left: 8rpx;
						font-weight: 500;
						font-size: 28rpx;
						color: #131313;
						line-height: 40rpx;
					}
				}
			}
		}

	}
</style>